package com.company.composite;

/**
 * 叶子对象角色，没有子节点对象
 */
public class Leaf extends Component{

    public Leaf(String name) {
        super(name);
    }

    /**
     * 展示组件名字
     */
    @Override
    public void display(String str) {
        System.out.println(str + "-" + this.getName());
    }
}
